<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@ taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@ taglib uri="/WEB-INF/tld/mallutil.tld" prefix="mu"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<style>
.filtertool .pferent-warp .pf-harea-f .checkbox{margin:5px 5px 0;*margin:5px 4px 0;cursor:pointer;float:left;}
.morepdinfo1{position:absolute; z-index:1000;top:5px;left:50px;width:310px;}
.morepdinfo1 .arrowarea{float:left;margin:5px 0px;overflow:hidden;}
.morepdinfo1 .arrowarea img{margin-top:140px;}
.morepdinfo1 .pdinfo{float:left;border:2px solid #d03070;padding:10px;background:#FFF;}
.morepdinfo1 .pdinfo img{padding:5px;border:#CCC 1px solid;}
.morepdinfo1 .pdinfo em a{display:block;width:21em;height:15px;overflow:hidden;font-size:12px;color:#d02b6d;}
.morepdinfo1 .pdinfo h2{display:block;width:17em;height:36px;*height:35px;overflow:hidden;font-size:15px;margin:5px 0;}
.morepdinfo1 .pdinfo .money-area{display:block;}
.morepdinfo1 .pdinfo .money-area s{text-decoration:none;display:inline-block; width:9em; float:left;padding-top:3px;}
.morepdinfo1 .pdinfo .money-area s span{background:url(/images/s_line.gif) repeat-x 0 0; color:#999;padding-top:.15em; background-position:0 .15em;}
.morepdinfo1 .pdinfo .money-area strong{display:inline-block;float:left;color:#d02b6d; font-weight:bold;display:block; text-align:right; width:11.5em; height:2em;overflow:hidden;}
.morepdinfo1 .pdinfo .money-area strong span{font-size:15px; display:inline-block;padding-top:1px;}
.morepdinfo1 .pdinfo .pferent-area{clear:both;line-height:20px;}
.morepdinfo1 .pdinfo .pferent-area p{width:250px;height:20px;overflow:hidden;color:#666;}
.morepdinfo1 .pdinfo .btn-area{margin:10px 45px 0px;float:none;width:160px;}
.morepdinfo1 .pdinfo .fielddot{background:url(/images/link_dote.gif) repeat-x 0 center;font-size:0px;width:250px;height:15px;}
</style>
<s:url var="prodlink" value="/product/product.do"/>
<c-rt:set var="imgDomain" scope="request"><%=ServerValue.getImgDomain()%></c-rt:set>
<script src="/js/jquery.qtip-1.0.0-rc3.min.js"></script>
<script src="/js/jquery.lazyload.yaodian100.js"/>"></script>
<script type="text/javascript">
function toAddCartDetail(productId, spec, categoryPath, type){
	var error="";
	if($('#type').attr('value')=='1'){
		error+="预购商品只能直接购买！\r\n";
	} else {
		if($('#spec').attr('value')==''){
			error+="请选择商品属性！\r\n";
		}
	}
	var itemNo="itemNo:\""+productId+"\",";
	var specNo="specNo:\""+spec+"\",";
	var qty="qty:\"1\",";
	var categoryPath="categoryPath:\""+categoryPath+"\",";
	var type="type:\""+type+"\",";
	var webpath="webpath:\"<%=ServerValue.getFrontContentHtmlPath()%>/shopping/cart.do?\",";
	var presents="presents:null,";
	var addOns="addOns:null";
	var json="{";
	json+=itemNo;
	json+=specNo;
	json+=qty;
	json+=categoryPath;
	json+=type;
	json+=webpath;
	json+=presents;
	json+=addOns;
	json+="}";
	var jsonObj;
	eval("jsonObj="+json);
	addCart(jsonObj);
}


function addToWish(_this){
    cpId = $(_this).attr('id').split('_')[1];
		cpPrice = $(_this).attr('id').split('_')[2];
		$.post("<%=ServerValue.getFrontContextPath()%>/checkLogin.do",{pathparam:'<%=ServerValue.getFrontHostname()%>'+window.location.pathname+"?<%=request.getQueryString()%>&cpId="+cpId+"&cpPrice="+cpPrice},callback,"json");
		function callback(result){
			if(result=='login'){
				$.post("/ecmall/nonMember/checkLogin.do",{},saveWishNonmemberCheckResultP,"json");
			}else{
				window.location.replace("<%=ServerValue.getFrontContextPath()%>/tologin.do?redirect_url="+result); 
			}
		}
    }
$(function(){
	$('img').lazyload({
		placeholder:"http://s.yaodian100.com/images/none1.gif"
	});
	$('img', $('.arrowarea')).each(function(){
		$(this).attr('src', $(this).attr('original'));
	});
	$('img', $('.sub-menu')).each(function(){
		$(this).attr('src', $(this).attr('original'));
	});
	$('#form_searchKeyword').keyup(function(){
		$('#keyword').attr('value', $('#form_searchKeyword').attr('value'));
		if($(this).attr('value')!=''){
			hadKeyin=true;
			$('#keyword').attr('class', 'search-page');
			$('#relatedSort').show();
		}else{
			hadKeyin=false;
			$('#keyword').attr('class', 'search-dpage');
			$('#relatedSort').hide();
		}
	});
	$('#form_searchKeyword').change(function(){
		$('#keyword').attr('value', $('#form_searchKeyword').attr('value'));
		if($(this).attr('value')!=''){
			hadKeyin=true;
			$('#keyword').attr('class', 'search-page');
			$('#relatedSort').show();
		}else{
			hadKeyin=false;
			$('#keyword').attr('class', 'search-dpage');
			$('#relatedSort').hide();
		}
	});
	$('#checkAllFlag').click(function(){
		if($('#checkboxImg').attr('src')=='/images/search/checkbox-on.gif'){
			document.formObj.flag2.checked=false;
			document.formObj.flag3.checked=false;
			document.formObj.flag4.checked=false;
			document.formObj.flag5.checked=false;
			document.formObj.flag6.checked=false;
			document.formObj.flag7.checked=false;
			$('#checkboxImg').attr('src', '/images/search/checkbox-null.gif');
			totalCheck=0;
		}else{
		document.formObj.flag2.checked=true;
		document.formObj.flag3.checked=true;
		document.formObj.flag4.checked=true;
		document.formObj.flag5.checked=true;
		document.formObj.flag6.checked=true;
		document.formObj.flag7.checked=true;
		$('#checkboxImg').attr('src', '/images/search/checkbox-on.gif');
		totalCheck=6;
		}
	});
	$('#clearSearchFilterForm').click(function(){
		document.formObj.minPrice.value='';
		document.formObj.maxPrice.value='';
		document.formObj.partner.checked=false;
		document.formObj.flag1.checked=false;
		document.formObj.flag2.checked=false;
		document.formObj.flag3.checked=false;
		document.formObj.flag4.checked=false;
		document.formObj.flag5.checked=false;
		document.formObj.flag6.checked=false;
		document.formObj.flag7.checked=false;
		$('#checkboxImg').attr('src', '/images/search/checkbox-null.gif');
		totalCheck=0;
	});
	$('.pferent-warp').mouseover(function(){
		$('#promotionEventItem').show();
	});
	$('.pferent-warp').mouseout(function(){
		$('#promotionEventItem').hide();
	});
	$('.pferent-warp').mouseover(function(){
		$('.pferent-warp > a').attr('class', 'pf-harea-f');
	});
	$('.pferent-warp').mouseout(function(){
		$('.pferent-warp > a').attr('class', 'pf-harea');
	});
	$('.op-wrap').mouseover(function(){
		$('.filterdrop').show();
	});
	$('.op-wrap').mouseout(function(){
		$('.filterdrop').hide();
	});
	
		$('.arrowarea > img').css('margin-top', 0);
		$('.p_div').each(function(){
			var index=$(this).attr('id').replace('p_div_', '');
			$(this).mouseout(function(){
				focusItem='';
				
				setTimeout('hideItem('+index+')', 200);
				
			});
			
			//$('#p_div_'+index).mouseover(function(){
			//	buildPop(index);
			//	focusItem=index;
			//	setTimeout('checkItem('+index+')', 1500);
		  	//});

			
		});
	$('.camCheckbox').each(function(i){
		$(this).click(function(){
			if($(this).attr('checked')){
				totalCheck++;
				if(totalCheck==6){
					$('#checkboxImg').attr('src', '/images/search/checkbox-on.gif');
				}else if(totalCheck>0){
					$('#checkboxImg').attr('src', '/images/search/checkbox-gray.gif');
				}else{
					$('#checkboxImg').attr('src', '/images/search/checkbox-null.gif');
				}
			}else{
				totalCheck--;
				if(totalCheck>0){
					$('#checkboxImg').attr('src', '/images/search/checkbox-gray.gif');
				}else{
					$('#checkboxImg').attr('src', '/images/search/checkbox-null.gif');
				}
			}
		});
	});
	/*
	$('.filterdrop > li > a').each(function(){
		$(this).click(function(){
			$('.filterdrop > li > a').each(function(){
				$(this).removeClass('switchon');
			});
			$(this).addClass('switchon');
			$('.filterdrop').hide();
		});
	});
	*/
});
function checkItem(index){
	
	if(index==focusItem && focusItem!=''){
		
		showItem(index);
	}else{
		$('.morepdinfo1').each(function(){
			$(this).hide();
		});
		$('#moreInfoDiv').hide();
	}
}
function hideItem(index){
	
	if(index==focusItem && focusItem!=''){
		showItem(index);
	}else{
		$('.morepdinfo1').each(function(){
			$(this).hide();
		});
		$('#moreInfoDiv').hide();
	}
}
var isOnShow=false;
function showItem(index){
	if($('#morepdinfo1_'+index).css('display')!='none'){
		return;
	}
	var offset = $('#theId_'+index).offset();
	var infoLeft=offset.left+140;
	var showOnLeft=0;
	if(offset.left>(310) && getBrowserWidth()-offset.left<(310+160)){
		infoLeft=offset.left-(280);
		$('#morepdinfo1_'+index).css('left', infoLeft);
		//show on left
		$('#infoLeft_'+index).hide();
		$('#infoRight_'+index).show();
		showOnLeft=1;
	}else{
		//show on right
		showOnLeft=0;
		infoLeft=offset.left+120;
  		$('#morepdinfo1_'+index).css('left', infoLeft);
  		$('#infoLeft_'+index).show();
		$('#infoRight_'+index).hide();
		
	}
	var topShift=340;
	var infoTop=offset.top-topShift;
	$('.arrowarea').css('margin-top', 220);
	//BOTTOM POSITION

	var bottomPosition=getScrollTop()+getBrowserHeight();
	if(bottomPosition-offset.top<infoTop+$('#morepdinfo1_'+index).height()){
		infoTop=bottomPosition-$('#morepdinfo1_'+index).height();
		if(bottomPosition-(offset.top-90)<0){
			infoTop=offset.top-$('#morepdinfo1_'+index).height();
		}	
		if(bottomPosition-$('#morepdinfo1_'+index).height()>offset.top-140){
			infoTop=offset.top-200;
		}
	}
	if(offset.top-getScrollTop()-topShift<140){
		infoTop=getScrollTop();
		if(getScrollTop()>offset.top-140){
			infoTop=offset.top-140;
		}
		
		
	}
	$('.arrowarea').css('margin-top', offset.top-infoTop-140+20);

	var infoLeftShift=0;
	if(showOnLeft==0){
		infoLeftShift=15;
	}
  $('#morepdinfo1_'+index).css('top', infoTop);
	$('#moreInfoDiv').css('top', infoTop);
	$('#moreInfoDiv').css('left', infoLeft+infoLeftShift);
	$('#moreInfoDiv').css('height', $('#morepdinfo1_'+index).height()-5);
	$('#moreInfoDiv').css('width', $('#morepdinfo1_'+index).width()-30);
	
	$('#moreInfoIframe').css('height', $('#morepdinfo1_'+index).height()-5);
	$('#moreInfoIframe').css('width', $('#morepdinfo1_'+index).width()-30);
	
	$('#moreInfoDiv').show();
  
  $('#morepdinfo1_'+index).show();

}
var focusItem;
<c-rt:set var="flagCount" value="0" scope="request"/>
<c-rt:if test="${param.flag2=='1'}">
<c-rt:set var="flagCount" value="${flagCount+1}" scope="request"/>
</c-rt:if>
<c-rt:if test="${param.flag3=='1'}">
<c-rt:set var="flagCount" value="${flagCount+1}" scope="request"/>
</c-rt:if>
<c-rt:if test="${param.flag4=='1'}">
<c-rt:set var="flagCount" value="${flagCount+1}" scope="request"/>
</c-rt:if>
<c-rt:if test="${param.flag5=='1'}">
<c-rt:set var="flagCount" value="${flagCount+1}" scope="request"/>
</c-rt:if>
<c-rt:if test="${param.flag6=='1'}">
<c-rt:set var="flagCount" value="${flagCount+1}" scope="request"/>
</c-rt:if>
<c-rt:if test="${param.flag7=='1'}">
<c-rt:set var="flagCount" value="${flagCount+1}" scope="request"/>
</c-rt:if>

var totalCheck=${flagCount};
function getScrollTop(){
	if ($.browser.msie) {
		return document.compatMode == "CSS1Compat"?document.documentElement.scrollTop:document.body.scrollTop;
	}else{
		if(document.documentElement.scrollTop){
			return document.documentElement.scrollTop;
		}else{
			return document.body.scrollTop;
		}
	}
}
function getBrowserHeight() {
	if ($.browser.msie) {
	return document.compatMode == "CSS1Compat"?document.documentElement.clientHeight:document.body.clientHeight;
	} else {
	return self.innerHeight;
	}
	}
	//取得瀏覽器視窗寬度

	function getBrowserWidth() {
	if ($.browser.msie) {
	return document.compatMode == "CSS1Compat"?document.documentElement.clientWidth:document.body.clientWidth;
	} else {
	return self.innerWidth;
	}
	}
	function encodeKeyword2_(){
		if(document.formObj.searchKeyword.value=="" && document.formObj.z.value=='' && document.formObj.brandId.value==''){
			alertDialog('高级搜索','请输入<em>商品关键字</em>或商品类别！','','400','180');
		}else{
			encodeKeyword2();
		}
		
	}
	var showIndex='';
function buildPop(index){
	if(showIndex!=''){
		var indexs=showIndex.split(',');
		var hasIndexed=false;
		for(i=0;i<indexs.length;i++){
			if(indexs[i]==index){
				hasIndexed=true;
				break;
			}
		}
		if(!hasIndexed){
		showIndex+=','+index;
		}else{
			return;
		}
	}else{
		showIndex=index;
	}
	
	var productId=$('#productId'+index).attr('value');
	var ct=$('#ct'+index).attr('value');
	var productId_4=$('#productId_4'+index).attr('value');
	var promoteName=$('#promoteName'+index).attr('value');
	var escapePromoteName=$('#escapePromoteName'+index).attr('value');
	var escapeProductName=$('#escapeProductName'+index).attr('value');
	var listPrice=$('#listPrice'+index).attr('value');
	var shelfPrice=$('#shelfPrice'+index).attr('value');
	var campaignStr='';
	$('.campaigns'+index).each(function(){
		campaignStr+='<p><span class="type-4">优惠</span><span title="'+$(this).attr('value')+'">'+$(this).attr('value')+'</span></p> ';
	});
	var hasCoupon=$('#hasCoupon'+index).attr('value');
	var coupon=$('#coupon'+index).attr('value');
	var couponStr='';
	if(hasCoupon=='true'){
		
		couponStr='<p><span class="type-money">&nbsp;</span>买就<span class="txt-rd">送积分 '+coupon+'</span></p>';
	}
	var hasPresent=$('#hasPresent'+index).attr('value');
	var present=$('#present'+index).attr('value');
	var presentStr='';
	if(hasPresent=='true'){
		var presents=present.split(',');
		for(i=0;i<presents.length;i++){
		presentStr='<p><span class="type-2">赠品</span> <span title="'+presents[i]+'">'+presents[i]+'</span> </p>';
		}
	}
	var productType=$('#productType'+index).attr('value');
	var hasAddon=$('#hasAddon'+index).attr('value');
	var addonStr='';
	if(productType!='6' && hasAddon=='true'){
		addonStr='<p><span class="type-3">加購</span>搭配加购享加值优惠</p> ';
	}
	var expectShipDate=$('#expectShipDate'+index).attr('value');
	var expectShipDateStr='';
	if(productType=='1'){
		expectShipDateStr='<p class="pre-txt"><span class="type-1">预购</span>预计<span class="txt-rd">'+expectShipDate+'</span>出货</p>';
	}
	var content=''+
		 

		 '<a href="/ecmall/product/product.do?productId='+productId+'&z='+ct+'"><img src="http://s.yaodian100.com/PImg/'+productId_4+'/'+productId+'/'+productId+'_m250.jpg" border="0"  onError="this.src=\'/PImg/blank_250.gif\'"></a>'+
		 '<em><a href="/ecmall/product/product.do?productId='+productId+'&z='+ct+'" title="'+promoteName+'">'+escapePromoteName+'</a></em>'+
		 '<h2><a href="/ecmall/product/product.do?productId='+productId+'&z='+ct+'">'+escapeProductName+'</a></h2>'+
		 '<div class="fielddot"> </div>'+
		 '<div class="money-area"><s><span>市场价:￥'+listPrice+'</span></s><strong>会员价:<span>￥'+shelfPrice+'</span></strong></div>'+
		         '<div class="pferent-area">'+
				 campaignStr+
		         couponStr+
		         presentStr+
		         addonStr+
		         expectShipDateStr+
		           '</div>'+
		           '<div class="fielddot"> </div>'+
		           '<div class="btn-area">'+
		           
		           '<a href="${prodlink}?productId='+productId+'&z='+ct+'" class="sbuy" target="_blank">购买</a>'+
		           '<a href="#" id="addWishList_'+productId+'_'+shelfPrice+'" class="icon-collection" onclick="addToWish(this)">加入收藏</a></div>'+
		         
			'';

	$('#morepdinfo1_'+index+' .pdinfo').html(content);
	
}
function encodeKeyword(ky){
	 if ( "" != ky )
		 $(":input[name='searchKeyword']").val(ky);
	 var params = jQuery("#searchForm").serialize(); // http request parameters.
	 params = encodeURI(params); 
	 location.href="/ecmall/search/search.do?" + params;
	}
</script>

	<!-- content start -->
	<div class="content" id="searchresults"><!-- 过滤bar -->

	<c-rt:if test="${result1.total>0}">
		<s:form name="formObj" action="search.do" method="get" id="formObj" acceptcharset="UTF-8">
			<input type="hidden" name="totalPage" value="${pager.pageSize }"/>
			<s:hidden name="pager.currentPage" id="currentPage"/>
			<s:hidden name="type"/>
			<s:hidden name="display"/>
			<s:hidden name="sortOrder"/>
	<input type="hidden" name="searchWithBrief" value="${!empty param.searchWithBrief?param.searchWithBrief:'0' }"/>
	<input type="hidden" name="searchWithDescription" value="${!empty param.searchWithDescription?param.searchWithDescription:'0' }"/>
	<input type="hidden" name="startDate" value="${param.startDate }"/>
	<input type="hidden" name="endDate" value="${param.endDate }"/>
	<input type="hidden" name="z" class="z" value="${param.z }"/>
	<input type="hidden" name="fuzzySearch" value="${param.fuzzySearch }"/>
	<input type="hidden" name="brandId" value="${param.brandId }"/>
	<c-rt:if test="${!empty result1.relatedTerms}">
	<div class="otherkword"> 
		<h4>相关搜索：</h4>
		<c-rt:forEach items="${result1.relatedTerms}" var="relatedTerm" varStatus="status">
		<c-rt:if test="${status.index!=0}"> , </c-rt:if><a href="#" onclick="$('#form_searchKeyword').attr('value', '${relatedTerm }');encodeKeyword2_();">${relatedTerm }</a>
		</c-rt:forEach>
      </div> 
      </c-rt:if>
	<div class="filterbar">
	<div class="filtertool">
		
          <div class="f-lt"><span>关键字：</span><input type="text" class="filter-kword" id="form_searchKeyword" name="searchKeyword" value="${pu:urlDecoding(param.searchKeyword, 'UTF-8') }"></div> 
          <div class="f-lt"><span class="fprice-txt">价格区间：</span><input type="text" class="filter-price" name="minPrice" value="${minPrice }"></div> 
          <div class="f-lt"><span class="fprice-txt2">至</span><input type="text" class="filter-price" name="maxPrice" value="${maxPrice }"><span class="fprice-txt2">元</span></div> 
          <div class="f-lt"> 
          <div class="pferent-warp"> 
          <a href="javascript:void(0);" id="checkAllFlag" class="pf-harea">
			<c-rt:if test="${flagCount==0}">
          <img id="checkboxImg" src="/images/search/checkbox-null.gif" class="checkbox"/>
          </c-rt:if>
          <c-rt:if test="${flagCount>0 && flagCount<6}">
          <img id="checkboxImg" src="/images/search/checkbox-gray.gif" class="checkbox"/>
          </c-rt:if>
          <c-rt:if test="${flagCount==6}">
          <img id="checkboxImg" src="/images/search/checkbox-on.gif" class="checkbox"/>
          </c-rt:if>

			<span>限优惠活动</span></a> 
          <ul id="promotionEventItem" class="pfitem" style="display:none"> 
          <li><label><input type="checkbox" class="checkbox camCheckbox" value="1" name="flag2" <c-rt:if test="${param.flag2=='1' }">checked="checked"</c-rt:if>><span>立减优惠</span></label></li> 
          <li><label><input type="checkbox" class="checkbox camCheckbox" value="1" name="flag3" <c-rt:if test="${param.flag3=='1' }">checked="checked"</c-rt:if>><span>立折优惠</span></label></li> 
          <li><label><input type="checkbox" class="checkbox camCheckbox" value="1" name="flag4" <c-rt:if test="${param.flag4=='1' }">checked="checked"</c-rt:if>><span>送赠品</span></label></li> 
          <li><label><input type="checkbox" class="checkbox camCheckbox" value="1" name="flag6" <c-rt:if test="${param.flag6=='1' }">checked="checked"</c-rt:if>><span>任选商品</span></label></li> 
          <li><label><input type="checkbox" class="checkbox camCheckbox" value="1" name="flag7" <c-rt:if test="${param.flag7=='1' }">checked="checked"</c-rt:if>><span>加购商品</span></label></li> 
          <!--[if IE 6]><iframe class="selectbug" frameborder="0" scrolling="no" src="about:blank"></iframe><![endif]--> 
          </ul></div></div> 
          
          <div class="f-lt"><div class="daphne-wrap"><label><input type="checkbox" class="checkbox" id="DAPHNE" value="DAPHNE" name="partner" <c-rt:if test="${pu:contain(param.partner, 'DAPHNE') }">checked="checked"</c-rt:if>><span>门店取货</span></label></div></div>
          
          <div class="f-lt"><label><input type="checkbox" class="checkbox" id="flag01" value="1" name="flag1" <c-rt:if test="${param.flag1=='1' }">checked="checked"</c-rt:if>><span>不包含预购</span></label></div> 
          <div class="submit-wrap"><a id="submitSearchFilterForm" href="#" onclick="encodeKeyword2_();return false;" class="submit-btn"><span>确认</span></a><a id="clearSearchFilterForm" href="#" class="clear-btn2"><span>清除</span></a></div> 
        
        </div> 
        <div class="ordertool"> 
	<div class="f-lt"><span>浏览模式：</span></div>
	<a class="mode-icon01" onclick="document.formObj.display.value='text';encodeKeyword2_();return false;"><span>列表</span></a>
	<div class="mode-icon02-f"><span>图片</span></div>
	
	<div class="f-lt"><span>排序：</span><div class="op-wrap"><a class="orderbtn" href="javascript:void(0);">
	<c:choose>
		<c:when test="${param.sortOrderType==0}">
		上架时间新到旧
		</c:when>
		<c:when test="${param.sortOrderType==1}">
		上架时间旧到新
		</c:when>
		<c:when test="${param.sortOrderType==2}">
		价格低到高
		</c:when>
		<c:when test="${param.sortOrderType==3}">
		价格高到低
		</c:when>
		<c:when test="${param.sortOrderType==4}">
		销售排行高到低
		</c:when>
		<c:when test="${param.sortOrderType==5}">
		销售排行低到高
		</c:when>
		<c:when test="${param.sortOrderType==6}">
		相关度
		</c:when>
		<c:otherwise>
		<c-rt:if test="${empty param.searchKeyword}">
		上架时间新到旧
		</c-rt:if>
		<c-rt:if test="${!empty param.searchKeyword}">
		相关度
		</c-rt:if>
		
		</c:otherwise>
	</c:choose>
	</a>
	
	<ul class="filterdrop" style="display:none">
	<li><${param.sortOrderType==0?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 0);$('.orderbtn').html($(this).html());encodeKeyword2_()" >上架时间新到旧</${param.sortOrderType==0?'div':'a' }></li>
	<li class="groupend"><${param.sortOrderType==1?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 1);$('.orderbtn').html($(this).html());encodeKeyword2_()" >上架时间旧到新</${param.sortOrderType==1?'div':'a' }></li>
	<li><${param.sortOrderType==2?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 2);$('.orderbtn').html($(this).html());encodeKeyword2_()" >价格低到高</${param.sortOrderType==2?'div':'a' }></li>
	<li class="groupend"><${param.sortOrderType==3?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 3);$('.orderbtn').html($(this).html());encodeKeyword2_()" >价格高到低</${param.sortOrderType==3?'div':'a' }></li>
	<li><${param.sortOrderType==4?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 4);$('.orderbtn').html($(this).html());encodeKeyword2_()" >销售排行高到低</${param.sortOrderType==4?'div':'a' }></li>
	<li class="groupend"><${param.sortOrderType==5?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 5);$('.orderbtn').html($(this).html());encodeKeyword2_()" >销售排行低到高</${param.sortOrderType==5?'div':'a' }></li>

	<li <c-rt:if test="${empty param.searchKeyword}">style="display:none"</c-rt:if> id="relatedSort"><${(param.sortOrderType==6||empty param.sortOrderType)?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 6);$('.orderbtn').html($(this).html());encodeKeyword2_()" >相关度</${(param.sortOrderType==6|| empty param.sortOrderType)?'div':'a' }></li>

	</ul>
	<c-rt:if test="${!empty param.searchKeyword}">
	<input type="hidden" name="sortOrderType" value="${!empty param.sortOrderType?param.sortOrderType:'6' }" id="sortOrderType"/>
	</c-rt:if>
	<c-rt:if test="${empty param.searchKeyword}">
	<input type="hidden" name="sortOrderType" value="${!empty param.sortOrderType?param.sortOrderType:'0' }" id="sortOrderType"/>
	</c-rt:if>
	</div></div>  
<div class="f-lt"><span class="show-num">每页显示：</span>
<select class="" name="pageSize" onchange="encodeKeyword2_()">
<option value="40" <c-rt:if test="${param.pageSize==40 }">selected="selected"</c-rt:if>>40</option>
<option value="60" <c-rt:if test="${param.pageSize==60 }">selected="selected"</c-rt:if>>60</option>
</select>
</div> 

<p align="right">共${pager.totalSize}笔：${pager.currentPage+1}/${pager.pageSize} 
<c:choose><c:when test="${pager.currentPage==0}">
	<span class="a-no">&lt; 上一页</span>
</c:when><c:otherwise>
	<a href="###" onclick="document.formObj.currentPage.value=${pager.currentPage-1};encodeKeyword2_();return false;"><span class="a-togo">&lt; 上一页</span></a>
</c:otherwise></c:choose>
 | 
<c:choose><c:when test="${pager.currentPage == pager.pageSize-1}">
	<span class="a-no"> 下一页 &gt;</span>
</c:when><c:otherwise>
	<a href="###" onclick="document.formObj.currentPage.value=${pager.currentPage+1};encodeKeyword2_();return false;"><span class="a-togo">下一页 &gt;</span></a>
</c:otherwise></c:choose>
</p>
	</div>
	</div>
	</s:form>
	<!-- 过滤bar -->
	
<!-- 图片结果展示区 --> 

		<ul class="pdlist-img">
<c-rt:forEach items="${result1.docs }" var="doc" varStatus="status">
<c-rt:set var="rpn">
<b>${pu:urlDecoding(param.searchKeyword, 'UTF-8') }</b>
</c-rt:set>
<%--
<c-rt:choose>
<c-rt:when test="${!empty param.z && param.z!='0'}">
${pu:reqSet('categoryId', param.z) }
${pu:reqSet('ct', param.z) }
</c-rt:when>
<c-rt:otherwise>
--%>
${pu:reqSet('categoryId', doc.mainCategoryId) }
${pu:reqSet('ct', doc.mainCategoryId) }
<%--
</c-rt:otherwise>
</c-rt:choose>
--%>
<c-rt:if test="${doc.type ne 6}">
<%try{ %>
${pu:reqSet('campaigns', pu:validCampaign(categoryId, doc.productId))}
<%}catch(Exception e){} %>
</c-rt:if>
        	<li> 
        	
        	
        	<input type="hidden" name="productId" id="productId${status.index }" value="${doc.productId }"/>
        	<input type="hidden" name="ct" id="ct${status.index }" value="${ct }"/>
			<input type="hidden" name="productId_4" id="productId_4${status.index }" value="${pu:substring(doc.productId, 0, 4)}"/>
			${pu:reqSet('promoteName', doc.promoteName) }
			${pu:reqSet('"escapePromoteName"', pu:replaceAll(doc.promoteName, pu:urlDecoding(param.searchKeyword, 'UTF-8'), rpn)) }
			${pu:reqSet('escapeProductName', pu:replaceAll(doc.productName, pu:urlDecoding(param.searchKeyword, 'UTF-8'), rpn) ) }
			${pu:reqSet('present', doc.present) }
			<%
			String promoteName=(String)request.getAttribute("promoteName");
			if(promoteName!=null)
			promoteName=promoteName.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "").replaceAll("\'", "&#39;");
			String escapePromoteName=(String)request.getAttribute("escapePromoteName");
			if(escapePromoteName!=null)
			escapePromoteName=escapePromoteName.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "").replaceAll("\'", "&#39;");
			String escapeProductName=(String)request.getAttribute("escapeProductName");
			if(escapeProductName!=null)
			escapeProductName=escapeProductName.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "").replaceAll("\'", "&#39;");
			String present=(String)request.getAttribute("present");
			if(present!=null)
			present=present.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "").replaceAll("\'", "&#39;");
			%>
			<input type="hidden" name="promoteName" id="promoteName${status.index }" value="${promoteName }"/>
			<input type="hidden" name="escapePromoteName" id="escapePromoteName${status.index }" value="${escapePromoteName }"/>
			<input type="hidden" name="escapeProductName" id="escapeProductName${status.index }" value="${escapeProductName }"/>
			<input type="hidden" name="listPrice" id="listPrice${status.index }" value="${doc.listPrice }"/>
			<input type="hidden" name="shelfPrice" id="shelfPrice${status.index }" value="${doc.shelfPrice }"/>
			<c-rt:if test="${!empty campaigns}">
			 <c-rt:forEach items="${campaigns}" var="campaign">
			 ${pu:reqSet('theCampaignName', campaign.campaignName) }
			 <%
			 String theCampaignName=(String)request.getAttribute("theCampaignName");
			 if(theCampaignName!=null)
			 theCampaignName=theCampaignName.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "").replaceAll("\'", "&#39;");
			 %>
            <input type="hidden" name="campaigns" class="campaigns${status.index }" value="${theCampaignName }"/>
            </c-rt:forEach>
			</c-rt:if>
			<input type="hidden" name="hasCoupon" id="hasCoupon${status.index }" value="${doc.hasCoupon }"/>
			<input type="hidden" name="coupon" id="coupon${status.index }" value="${doc.coupon }"/>
			
			<input type="hidden" name="hasPresent" id="hasPresent${status.index }" value="${doc.hasPresent}"/>
			<input type="hidden" name="present" id="present${status.index }" value="${present}"/>
			
			<input type="hidden" name="productType" id="productType${status.index }" value="${doc.type}"/>
			<input type="hidden" name="hasAddon" id="hasAddon${status.index }" value="${doc.hasAddon}"/>
			
			${pu:reqSet('product', pu:get('com.yaodian100.ec.product.entity.Product', doc.productId)) }
			<c-rt:if test="${!empty product.expectShipDate}">
			<c-rt:set var="expectShipDate" scope="request">
			<fmt-rt:formatDate value="${product.expectShipDate}" pattern="yyyy-MM-dd"/>
			</c-rt:set>
			</c-rt:if>
			<input type="hidden" name="expectShipDate" id="expectShipDate${status.index }" value="${expectShipDate}"/>

        	
        	
        	
        	
        	
        	
        	
        	
        	
        	
        		<div class="p_div" id="p_div_${status.index }">
            	<a href="/ecmall/product/product.do?productId=${doc.productId }&z=${ct}" target="_blank" class="p_img" id="p_img_${status.index }">
            	<c-rt:if test="${status.index>=16}">
				<img class="pd-img" id="pd-img_${status.index }" src="${imgDomain}/images/none1.gif" original="${imgDomain}/PImg/<c:out value="${fn:substring(doc.productId,0,4)}"/>/${doc.productId}/${doc.productId}_rm225.jpg" alt="${doc.productName}" width="170" height="225" onError="this.src='${imgDomain}/PImg/blank_r225.gif'"/>
				</c-rt:if>
				<c-rt:if test="${status.index<16}">
				<img class="pd-img" id="pd-img_${status.index }" src="${imgDomain}/PImg/<c:out value="${fn:substring(doc.productId,0,4)}"/>/${doc.productId}/${doc.productId}_rm225.jpg" alt="${doc.productName}" width="170" height="225" onError="this.src='${imgDomain}/PImg/blank_r225.gif'"/>
				</c-rt:if>
				</a>
				
				<div id="theId_${status.index }">
				<div class="morepdinfo1" id="morepdinfo1_${status.index }" style="display:none">
				
				<div id="infoLeft_${status.index }" class="arrowarea"><img src="/images/mpdinfo-areal.gif" border="0" style="border:0px"></div>
				
<div class="pdinfo">
</div>
				 <div id="infoRight_${status.index }" class="arrowarea"><img src="/images/mpdinfo-arear.gif" border="0" style="border:0px"></div>
				</div>
        	</div>
				</div>
				
				
                <em <c-rt:if test="${!empty campaigns}">class="pficon"</c-rt:if>>${pu:replaceAll(doc.promoteName, pu:urlDecoding(param.searchKeyword, 'UTF-8'), rpn) }
                
                </em> 
                <h6><a href="${prodlink}?productId=${doc.productId}" target="_blank">${pu:replaceAll(doc.productName, pu:urlDecoding(param.searchKeyword, 'UTF-8'), rpn) }</a></h6>
                <s><span>￥<fmt-rt:formatNumber value="${doc.listPrice}"  pattern="########0.0"/></span></s><strong>￥<fmt-rt:formatNumber value="${doc.shelfPrice}"  pattern="########0.0"/></strong> 
            </li></c-rt:forEach>
        </ul> 
        <%--
        <c-rt:forEach items="${result1.docs }" var="doc" varStatus="status">
<c-rt:set var="rpn">
<b>${pu:urlDecoding(param.searchKeyword, 'UTF-8') }</b>
</c-rt:set>
<c-rt:choose>
<c-rt:when test="${!empty doc.percentOffStr}">
	<c-rt:set var="ct" scope="request">
${pu:getCategoryId(pu:split(doc.percentOffStr, ',')[0], '/')}
	</c-rt:set>
</c-rt:when>
<c-rt:when test="${!empty doc.priceDropStr}">
	<c-rt:set var="ct" scope="request">
${pu:getCategoryId(pu:split(doc.priceDropStr, ',')[0], '/')}
	</c-rt:set>
</c-rt:when>
<c-rt:otherwise>
	<c-rt:set var="ct" scope="request">
${pu:getCategoryId(doc.categoryPath, '##')}
	</c-rt:set>
</c-rt:otherwise>
</c-rt:choose>

       
        </c-rt:forEach>
        --%>
        <!-- 图片结果展示区 --> 

<jsp:include page="/common/collection.jsp"/>
	<p class="page-change cf">
	<a href="#" class="f-rt"><span class="a-top"></span>TOP</a> 
	第${pager.currentPage+1}页，共${pager.pageSize}页
<c:choose><c:when test="${pager.currentPage==0}">
	<span class="a-no">&lt; 上一页</span> |
</c:when><c:otherwise>
	<a href="###" onclick="document.formObj.currentPage.value=${pager.currentPage-1};encodeKeyword2_();return false;" class="a-togo">&lt; 上一页</a> |
</c:otherwise></c:choose>
<c:forEach begin="${pager.startPage}" end="${pager.endPage}" var="currentPage">
<c:choose><c:when test="${pager.currentPage==currentPage-1}">
	<b class="pg-now">${currentPage}</b>
</c:when><c:otherwise>
	<a href="###" onclick="document.formObj.currentPage.value=${currentPage-1};encodeKeyword2_();return false;">${currentPage}</a>
</c:otherwise></c:choose>
</c:forEach>
<c:choose><c:when test="${pager.currentPage == pager.pageSize-1}">
	<span class="a-no"> | 下一页 &gt;</span>
</c:when><c:otherwise>
	 | <a href="###" onclick="document.formObj.currentPage.value=${pager.currentPage+1};encodeKeyword2_();return false;" class="a-togo">下一页 &gt;</a>
</c:otherwise></c:choose>
<span class="goto">跳至第<input name="jumpPage" id="jumpPage" type="text" size="1" maxlength="3" />页。</span><a class="gotopbtn" href="#" onclick="if(isNaN($('#jumpPage').attr('value'))){alert('请填数字');}else{document.formObj.currentPage.value=($('#jumpPage').attr('value')-1);encodeKeyword2_();}"><span>确认</span></a>

</p>
<div id="moreInfoDiv" style="position:absolute;z-index:999;display:none">
<iframe id="moreInfoIframe"></iframe>
</div>
	<!--列表区块 END -->
	
	</c-rt:if>
	<c-rt:if test="${empty result1 || result1.total==0}">
	<form name="formObj" action="search.do" method="get" id="formObj" acceptcharset="UTF-8">
	<input type="hidden" name="z" value=""/>
	<div class="noresult"> 
<input type="hidden" id="form_searchKeyword" name="searchKeyword" value="${pu:urlDecoding(param.searchKeyword, 'UTF-8') }"/>
        <div class="sorry"> 
          <h2>很抱歉，沒有找到与"<b><c-rt:out value="${pu:urlDecoding(searchKeyword, 'UTF-8') }"/></b>"相关的内容。</h2> 
          <c-rt:if test="${fuzzySearchCount>0}">
          <p><a href="/ecmall/search/search.do?searchKeyword=${pu:urlEncoding(param.searchKeyword,'UTF-8')}&fuzzySearch=1">查看模糊搜索结果<%--(${fuzzySearchCount }) --%></a></p> 
          </c-rt:if>
        </div> 
        <div class="fielddot"></div> 
        <ul class="youtry"> 
          <h3>您可以尝试使用以下的方法：</h3> 
          <li>．查看输入的关键字是否有误。</li> 
          <li>．缩短或更改搜索的关键字后重新搜索。</li> 
          <li>．可点击类目进行筛选。</li> 
        </ul> 
      </div> 
      </form>
	</c-rt:if>
	
	
	</div>
	
	<div id="dialog"></div>
	
	<script type="text/javascript" src="http://s.yaodian100.com/js/rec.js">
	{
		"mid":27,
		"pid":"search",
		"kw":"${pu:urlDecoding(searchKeyword, 'UTF-8') }",
		<c-rt:if test="${!empty mu:memberId()}">
		"uid":"${mu:memberId()}",
		</c-rt:if>
		"layout":"search"
	}
	</script>
	
	<!-- content end -->